<?php
if (!defined('MVC_ROOT_DIR'))  die('Hacking attempt');
class BaseUserActions extends Actions {
    public $m;
    public $uid;
	function __construct()
	{	
		if (!key_exists('islogin',$_SESSION) and !in_array(Http::get('actions'),array('login','reg','binfo'))){	
		    if (Http::get('ajax')=='1'){
		        die(json_encode(array('result'=>0,'msg'=>'请登录！')));
		    }	  		
			$this->location('user/login/');
		}
		if (key_exists('user', $_SESSION)) {		 
		    $this->uid = $_SESSION['user']['uid'];
		    $this->assign('user', $_SESSION['user']);
		}
		Files::factory('user');
		$this->m = new User();
	    $this->addJs(MVC_WWW_HOST.'js/jquery/jquery.js');
		$this->addCss(MVC_WWW_HOST.'css/frontpage.css');
		//print_r($_SESSION['user']);
		
        $this->assign('module', Http::get('module'));
        $this->assign('action', Http::get('actions'));
       
	}
	
	
}
